import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';

import 'package:get/get.dart';
import 'package:smart_translator/app/style/widget_style.dart';

import '../../../routes/app_pages.dart';
import '../../../widgets/AppHeader.dart';
import '../../../widgets/CommonWidgets.dart';
import '../controllers/choose_device_controller.dart';

class ChooseDeviceView extends GetView<ChooseDeviceController> {
  const ChooseDeviceView({super.key});
  @override
  Widget build(BuildContext context) {
    return SafeArea(child: Scaffold(
        body: SingleChildScrollView(
          child: Stack(
            children: [
              Container(
                child: SvgPicture.asset(
                  "assets/images/header_part_bg.svg",
                  width: Get.width,
                ),
              ),
              AppHeader.obtainHeaderWithoutRightPart('选择您的智译设备'),
              Container(
                width: Get.width,
                margin: EdgeInsets.only(top: 95.h),
                child: Column(
                  children: [
                    Container(
                      width: Get.width,
                      padding: EdgeInsets.all(25.w),
                      margin: EdgeInsets.only(left:25.w,right: 25.w, top: 55.h),
                      decoration: BoxDecoration(
                        boxShadow: [
                          CommonWidgets.getBoxShadow(),
                        ],
                        color:Colors.white,
                        borderRadius: BorderRadius.circular(16), // Optional: add border radius
                      ),
                      child: Column(
                        children: [
                          Text('智译Pro',style: AppStyleThemeData.PAGE_TITLE,),
                          SizedBox(height: 17.h,),
                          Image.asset('assets/images/product_device1.png',width: 128.w, height: 128.h),
                          SizedBox(height: 25.h,),
                          Container(
                            width: Get.width,
                            child: ElevatedButton(
                                onPressed: () {
                                  Get.toNamed(Routes.CONNECTING_DEVICE);
                                },
                                child: const Text("添加")
                            ),
                          )
                        ],
                      ),
                    ),
                    SizedBox(height: 250.h,),
                    Text("还没有智能设备?",style: AppStyleThemeData.linkStyle,)
                  ],
                ),
              )
            ],
          ),
        )
    ),top: false);
  }
}
